function tableActive() {
    table = d3.select("#dataTable")
    // table.selectAll("*").remove()
    d3.csv("./data/csv/HR_comma_sep.csv").then( data => {
        data.forEach(data => {
            if (data['promotion_last_5years'] == 0){
                data['promotion_last_5years'] = "否"
            } else {
                data['promotion_last_5years'] = "是"
            }

            if (data['left'] == 0){
                data['left'] = "否"
            } else {
                data['left'] = "是"
            }

            if (data['salary'] == 'low') {
                data['salary'] = "低"
            } else if (data['salary'] == 'high') {
                data['salary'] = "高"
            } else {
                data['salary'] = "中"
            }
        })
        
        let head = ["序号", "满意度", "绩效", "参与项目数（个）", "每月平均工作时间（小时）", "工作时长（年）", "工作过失（次）", "是否离职", "最近五年内是否有升职", "工作岗位", "薪资水平"]
        let toget =["satisfaction_level", "last_evaluation", "number_project", "average_montly_hours", "time_spend_company", "Work_accident", "left", "promotion_last_5years", "sales", "salary"]
        table.selectAll("*").remove()
        th = table.append("tr")
        
        // 画表头
        for( let i = 0; i < head.length; i++) {
            th.append("th")
                .attr("height", 10)
                .text(head[i])
        }
        
        // 画表
        for( let i = 0; i < tableData.length; i++) {
            let tr = table.append("tr")
            tr.append("td")
                .text(tableData[i])
            for( let j = 0; j < Object.keys( data[0] ).length; j++) {
                tr.append("td")
                    .text(data[tableData[i]][toget[j]])
            }
        }
    })
    
}